﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using Avalon.Windows.Controls;
using AvalonDock;
using Itenso.Windows.Input;

using OpenExpressApp.MetaModel;
using OpenExpressApp.Module.Command;
using OpenExpressApp.Module.Library;
using OpenExpressApp.Module.Library.Security;
using OpenExpressApp.Module.WPF.Templete;
using OpenExpressApp.Types;
using OpenExpressApp.WPF.Command;
using OpenExpressApp.WPF.Controls;
using OpenExpressApp.WPF.Editors;
using Wpf.Controls;

namespace OpenExpressApp.Module.WPF
{
    /// <summary>
    /// 界面生成工厂
    /// </summary>
    public interface IUIFactory
    {
        /// <summary>
        /// 自动生成列表UI
        /// </summary>
        /// <param name="boType"></param>
        /// <returns></returns>
        DataGrid CreateListControl(IListObjectView view);
        /// <summary>
        /// 自动生成树形列表UI
        /// </summary>
        /// <param name="boType"></param>
        /// <returns></returns>
        MultiObjectTreeView CreateTreeListControl(IListObjectView view);
        /// <summary>
        /// 创建详细视图
        /// </summary>
        /// <param name="detailView">逻辑视图</param>
        /// <param name="colCount">创建时，一行多少列。</param>
        /// <returns></returns>
        FrameworkElement CreateDetailView(DetailObjectView detailView, int colCount);
        /// <summary>
        /// 为主工具栏生成可用的一系统Button
        /// </summary>
        /// <param name="mainToolbar">需要生成按钮的ToolBar</param>
        /// <param name="boType">生成这个类型对应的按钮</param>
        /// <param name="view">boType对应的View</param>
        /// <param name="moduleType"></param>
        void CreateMainToolBar(ToolBar mainToolbar, Type boType, WPFObjectView view, ModuleType moduleType);
        /// <summary>
        /// 为子工具栏生成可用的一系统Button
        /// </summary>
        /// <param name="view">boType对应的View</param>
        /// <param name="boType">生成这个子类型对应的按钮</param>
        /// <param name="childToolbar">需要生成按钮的ToolBar</param>
        void CreateChildToolBar(WPFObjectView childView, Type boType);
    }
}
